













/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


import JCP.Browser;
import JCP.JavaClientPage;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Map;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 *
 * @author Pham
 */
public class Tester2 extends JPanel implements JavaClientPage {

protected Browser br;
protected Map<String,Object> parameters;
    public Tester2() {
    }
    public JPanel JavaClientPage = new JPanel();

    @Override
    public JPanel getBody() { 
        
        JLabel lbtest = new JLabel("This is Tester2 page");
        JLabel lbtest1 = new JLabel("Hello "+parameters.get("name"));
        JLabel lbtest2 = new JLabel("From"+parameters.get("city"));
        JavaClientPage.add(lbtest);
        JavaClientPage.add(lbtest1);
        JavaClientPage.add(lbtest2);
        JButton bttestnext = new JButton("Next");
        JButton bttestback = new JButton("Back");
        bttestnext.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                    br.go("http://localhost/Tester?name=Pham&city=London");
                  
            }
        });


        bttestback.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
            br.go("http://localhost/Tester2?name=Toan&city=London");
            }
        });

        JavaClientPage.add(bttestnext);
        JavaClientPage.add(bttestback);
        return JavaClientPage;

    }

    @Override
    public void setBrowser(Browser br) {
        this.br=br;
    }

    @Override
    public void setParameters(Map<String, Object> parameters) {
        this.parameters = parameters;
    }
}
